package sparkcore.day7.lesson01

import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}

/**
  * Created by Administrator on 2018/5/3.
  */
object Lesson02 {
  def main(args: Array[String]): Unit = {
    //程序入口
    val conf = new SparkConf().setMaster("local").setAppName("test")
    val sc = new SparkContext(conf)
    //不建议使用
    val sqlContext = new SQLContext(sc)
    val df=sqlContext.read.json("hdfs://hadoop1:9000/resources/people.json")

    df.createOrReplaceTempView("people")


  }
}
